package com.ljl.test;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.entity.Payplan;
import com.service.ljl.payplanservice;

public class payplantest {
	private payplanservice payplanservice;

	@Before
	public void init() {
		ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
		payplanservice = ac.getBean(payplanservice.class);
	}

	@After
	public void tearDown() {
		payplanservice = null;
	}

	@Test
	public void add() {

	}

	@Test
	public void find() {
		Map<Object, Object> map = payplanservice.findall(10, 1);

		List<Payplan> li = (List<Payplan>) map.get("payplans");
		for (int i = 0; i < li.size(); i++) {
			System.out.println(li.get(i).getOrder().getOrTitle());
			System.out.println(li.get(i).getOrder().getCustomer().getCname());
		}
	}

}
